package com.xuzao.developer.controller;

import com.xuzao.developer.annotation.MethodAnnotation;
import com.xuzao.developer.annotation.ModuleAnnotation;
import com.xuzao.developer.utils.BJUIMap;
import com.xuzao.developer.service.SysPowerService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @description 
 * @author xuzao
 * @date 2019-09-19 14:32:23
 **/
@ModuleAnnotation(name = "权限")
@Controller
@RequestMapping("/sysPower/")
public class SysPowerController{

	@Resource
	private SysPowerService sysPowerService;


	@MethodAnnotation(name = "保存")
	@RequestMapping("add")
	@ResponseBody
	public BJUIMap add(@RequestParam(required = false,name = "sysResourceIds",defaultValue = "") Long[] sysResourceIds,@RequestParam(name = "userId")Long userId){
		BJUIMap map = new BJUIMap();
		map.setStatusCode(BJUIMap.CODE_OK);
		map.setMessage("操作成功");
		map.setCloseCurrent(BJUIMap.CALLBACK_CLOSE);
		sysPowerService.insert(sysResourceIds,userId);
		return map;
	}

}